home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / ABUSESRC.ZIP / AbuseSrc / imlib / port / svga / monoprnt.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-23  |  599 b   |  33 lines

  1. #include <stdio.h>
  2. #include <stdarg.h>
  3. #include <unistd.h>
  4. #include <sys/types.h>
  5. #include <fcntl.h>
  6. #include <stdlib.h>
  7. #include "macs.hpp"
  8.  
  9. int monofd=-1;
  10.  
  11. void openmono()
  12. { monofd=open("/dev/tty8",O_WRONLY);
  13.   CONDITION(monofd!=-1,"unable to open debug tty\n");
  14. }
  15.  
  16. void mnclear()
  17. { if (monofd<0) openmono();
  18.   int i;
  19.   for (i=0;i<25;i++);
  20.     write(monofd,"\n",1);
  21. }
  22.  
  23. void mnprintf(const char *format, ...)
  24. {
  25.   char st[200];
  26.   va_list ap;
  27.   va_start(ap, format);
  28.   vsprintf(st,format,ap);
  29.   va_end(ap);
  30.   if (monofd<0) openmono();
  31.   write(monofd,st,strlen(st));
  32. }
  33.